import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralBizCategory = (params) => {
  params.head.transCode = 'queryGeneralBizCategory';
  return request({
    url: '/general/generalBizCategory/queryGeneralBizCategory',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralBizCategoryListPage = (params) => {
  params.head.transCode = 'queryGeneralBizCategoryListPage';
  return request({
    url: '/general/generalBizCategory/queryGeneralBizCategoryListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralBizCategory = (params) => {
  params.head.transCode = 'saveGeneralBizCategory';
  return request({
    url: '/general/generalBizCategory/saveGeneralBizCategory',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralBizCategoryList = (params) => {
  params.head.transCode = 'saveGeneralBizCategoryList';
  return request({
    url: '/general/generalBizCategory/saveGeneralBizCategoryList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralBizCategory = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralBizCategory';
  return request({
    url: '/general/generalBizCategory/saveOrUpdateGeneralBizCategory',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralBizCategoryList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralBizCategoryList';
  return request({
    url: '/general/generalBizCategory/saveOrUpdateGeneralBizCategoryList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralBizCategory = (params) => {
  params.head.transCode = 'updateGeneralBizCategory';
  return request({
    url: '/general/generalBizCategory/updateGeneralBizCategory',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralBizCategory = (params) => {
  params.head.transCode = 'deleteGeneralBizCategory';
  return request({
    url: '/general/generalBizCategory/deleteGeneralBizCategory',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralBizCategoryList = (params) => {
  params.head.transCode = 'deleteGeneralBizCategoryList';
  return request({
    url: '/general/generalBizCategory/deleteGeneralBizCategoryList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralBizCategoryExcel = (params) => {
  downloadExcel({
    url: '/general/generalBizCategory/excelDownload/exportGeneralBizCategoryExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
